Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/loki: support multiple instances of promtail (BREAKING CHANGE) #353

Merged
merged 11 commits into from
Jan 29, 2021

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Jan 25, 2021

⚠️ BREAKING CHANGE ⚠️

PR Description

Enables running multiple instances of Promtail in the same way one can run multiple instances of Prometheus. This is a breaking change. Configs in this form:

loki:
  positions:
    filename: /tmp/positions.yaml
  clients:
    - url: http://loki:3100/loki/api/v1/push
  scrape_configs:
  - job_name: system
    static_configs:
      - targets:
        - localhost
        labels:
          job: varlogs
          __path__: /var/log/*log

must be rewritten to be in this new form:

loki:
  configs:
  - name: default
    positions:
      filename: /tmp/positions.yaml
    clients:
      - url: http://loki:3100/loki/api/v1/push
    scrape_configs:
    - job_name: system
      static_configs:
        - targets:
          - localhost
          labels:
            job: varlogs
            __path__: /var/log/*log

Which issue(s) this PR fixes

Closes #313.

Notes to the Reviewer

Lots to do still. Opening this up in draft to get early feedback based on the versioning approach.

TODO:

  • Need to update the Promtail dependency so we can pass custom Prometheus registerers to each Promtail (done by update cortex, loki #355)
  • Needs a lot of testing, maybe add an agent-all-in-one.yaml to cmd/agent for local testing.
  • Positions file directory should be created on startup with 0700 permissions.

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

@56quarters
Copy link
Contributor

From discussion offline:

This seems reasonable, but as you mentioned it's a lot of code to support a change in configuration format that's not too difficult for people to migrate.

rfratto added a commit to rfratto/agent that referenced this pull request Jan 26, 2021
@rfratto rfratto mentioned this pull request Jan 26, 2021
3 tasks
rfratto added a commit that referenced this pull request Jan 27, 2021
@rfratto rfratto changed the title pkg/loki: support multiple instances of promtail pkg/loki: support multiple instances of promtail (BREAKING CHANGE) Jan 27, 2021
@rfratto rfratto marked this pull request as ready for review January 28, 2021 16:04
@rfratto rfratto merged commit 41e563b into grafana:master Jan 29, 2021
@rfratto rfratto deleted the multiple-promtail branch January 29, 2021 14:56
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
)

* pkg/loki: support multiple instances of promtail

* fix build, lint errors

* docs, fix configs

* hard break

* changelog

* create positions directory if it doesn't exist

* fix bugs from testing

* remove test extra loki config

* update remaining docs to use new loki config

* add more detail to the migration guide, config reference

* fix loki port
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Apr 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple Loki/Promtail instances
3 participants